<template>
  <div class="page_root" data-page-name="优化方案查询" data-page-identification="s_wb8p2la8u9">
    <a-spin :spinning="pageLoading.loading" :tip="pageLoading.tip">
      <!-- begin vid_kgqhpv9tb0 删除 -->
      <a-modal
        class="vid_kgqhpv9tb0"
        v-model:visible="vid_kgqhpv9tb0_props.visible"
        :centered="true"
        :title="'删除'"
        :maskClosable="false"
        :width="320"
        @cancel="handle_vid_kgqhpv9tb0_cancel"
        @ok="handle_vid_kgqhpv9tb0_ok"
      >
        <!-- begin vid_hybbjs01xq 简单文本_c9n7d8d1iz -->
        <span class="vid_hybbjs01xq"> 是否删除此内容？ </span>
        <!-- end vid_hybbjs01xq 简单文本_c9n7d8d1iz -->
      </a-modal>
      <!-- end vid_kgqhpv9tb0 删除 -->
      <!-- begin vid_3rzp8k96m3 删除成功全局提示_7u0ncyeoam -->
      <!-- end vid_3rzp8k96m3 删除成功全局提示_7u0ncyeoam -->
      <!-- begin vid_2fmud4fowu 删除失败全局提示_meoci57xlw -->
      <!-- end vid_2fmud4fowu 删除失败全局提示_meoci57xlw -->
      <!-- begin vid_2ld27fg9p1 上传成功全局提示_k4skajk36l -->
      <!-- end vid_2ld27fg9p1 上传成功全局提示_k4skajk36l -->
      <!-- begin vid_30oaw4n56n 上传失败全局提示_v39esmre07 -->
      <!-- end vid_30oaw4n56n 上传失败全局提示_v39esmre07 -->
      <!-- begin vid_ocmnae10ai 面包屑_yeq3bbxl0g -->
      <a-breadcrumb class="vid_ocmnae10ai" style="word-break: break-word">
        <a-breadcrumb-item v-for="(item, index) in vid_ocmnae10ai_props_tabConfig" :key="index" @click="handleBreadcrumbJump(router, item)" href="">
          <template v-if="vid_ocmnae10ai_props.rt_showIcon">
            <span v-if="/^(https?:|mailto:|tel:|data:image)/.test(item.icon)" role="img" class="anticon"><embed style="width: 1em;height:1em;" :src="item.icon" /></span>
            <component v-else :is="item.icon" />
          </template>
          {{item.title}}
        </a-breadcrumb-item>
      </a-breadcrumb>
      <!-- end vid_ocmnae10ai 面包屑_yeq3bbxl0g -->
      <!-- begin vid_map3m5zrof 容器_8ymyg9wo7n -->
      <al-box class="vid_map3m5zrof">
        <!-- begin vid_m8d54ggtsv 表单容器_4n7fy0jwrt -->
        <a-form ref="vid_m8d54ggtsv_ref" class="vid_m8d54ggtsv" :model="r_rg3lk1tq6l" :formModel="vid_m8d54ggtsv_props.formModel">
          <!-- begin vid_83xfputcbw 布局容器_1h7volox9b -->
          <a-row class="vid_83xfputcbw" :gutter="16" :slots="'6:6:6:6'">
            <a-col :span="6">
              <!-- begin vid_zus6475leb 表单项容器_fennf3wy1d -->
              <a-form-item name="name" :rules="r_rg3lk1tq6l_rules[`name`]" class="vid_zus6475leb" :label-col='{"span":6}' :wrapper-col='{"span":18}'>
                <!-- begin vid_mm4tf1nvze searchForm_Name -->
                <a-input autocomplete="off" class="vid_mm4tf1nvze" v-model:value="r_rg3lk1tq6l.name"> </a-input>
                <!-- end vid_mm4tf1nvze searchForm_Name -->
                <template #label>
                  <!-- begin vid_l92m3gweno 配送方案名称 -->
                  <span class="vid_l92m3gweno"> 配送方案名称 </span>
                  <!-- end vid_l92m3gweno 配送方案名称 -->
                </template>
              </a-form-item>
              <!-- end vid_zus6475leb 表单项容器_fennf3wy1d -->
            </a-col>
            <a-col :span="6">
              <!-- begin vid_pfitccaasx 容器_urbjco6urt -->
              <al-box class="vid_pfitccaasx">
                <!-- begin vid_kixb6r8oe1 按钮_xbyz09zos2 -->
                <a-button class="vid_kixb6r8oe1" :type="'primary'" @click="handle_vid_kixb6r8oe1_click">
                  <template #icon
                    ><span role="img" class="anticon"
                      ><embed
                        style="width: 1em;height:1em;"
                        src="" /></span
                  ></template>

                  查询
                </a-button>
                <!-- end vid_kixb6r8oe1 按钮_xbyz09zos2 -->
                <!-- begin vid_92fg79r9vi 按钮_lntbhi1252 -->
                <a-button class="vid_92fg79r9vi" @click="handle_vid_92fg79r9vi_click">
                  <template #icon><reload-outlined /></template>

                  重置
                </a-button>
                <!-- end vid_92fg79r9vi 按钮_lntbhi1252 -->
              </al-box>
              <!-- end vid_pfitccaasx 容器_urbjco6urt -->
            </a-col>
            <a-col :span="6"> </a-col>
            <a-col :span="6"> </a-col>
          </a-row>
          <!-- end vid_83xfputcbw 布局容器_1h7volox9b -->
        </a-form>
        <!-- end vid_m8d54ggtsv 表单容器_4n7fy0jwrt -->
        <!-- begin vid_6dzcjonxof 容器_w5r7gezio8 -->
        <al-box class="vid_6dzcjonxof">
          <!-- begin vid_fpwv36k9re 布局容器_w41tl6sq3p -->
          <a-row class="vid_fpwv36k9re" :slots="'12:12'">
            <a-col :span="12">
              <!-- begin vid_71pl2koca3 配送优化方案版本 -->
              <span class="vid_71pl2koca3"> 配送优化方案版本 </span>
              <!-- end vid_71pl2koca3 配送优化方案版本 -->
            </a-col>
            <a-col :span="12">
              <!-- begin vid_smwvdp5o43 容器_fvq7lbr6cy -->
              <al-box class="vid_smwvdp5o43">
                <!-- begin vid_3beahpfrj3 按钮_hr45qap6hx -->
                <a-button class="vid_3beahpfrj3" style="background: none" :type="'primary'" @click="handle_vid_3beahpfrj3_click"> 下载模板 </a-button>
                <!-- end vid_3beahpfrj3 按钮_hr45qap6hx -->
                <!-- begin vid_vk9gw8xwnc 创建方案 -->
                <a-button class="vid_vk9gw8xwnc" @click="handle_vid_vk9gw8xwnc_click">
                  <template #icon><plus-outlined /></template>

                  创建方案
                </a-button>
                <!-- end vid_vk9gw8xwnc 创建方案 -->
                <!-- begin vid_dpvyypxome 文件上传_faze9omc4f -->
                <al-upload
                  class="vid_dpvyypxome"
                  :uploadFile="vid_dpvyypxome_props.uploadFile"
                  v-model:fileList="vid_dpvyypxome_props.fileList"
                  :withCredentials="true"
                  :showUploadList="false"
                  :textContent="'导入EXCEL'"
                  :accept="'.xlsx'"
                  :action="'/solution-zjcnfsn-distribution/api/v1/data/import/distribution_compare'"
                  :errorMsg="vid_dpvyypxome_props.errorMsg"
                  @uploadSuccess="handle_vid_dpvyypxome_uploadSuccess"
                  @uploadFailed="handle_vid_dpvyypxome_uploadFailed"
                >
                </al-upload>
                <!-- end vid_dpvyypxome 文件上传_faze9omc4f -->
                <!-- begin vid_647uqdy6do 按钮_flajwnvv58 -->
                <a-button class="vid_647uqdy6do" :type="'primary'" :disabled="vid_647uqdy6do_props.disabled" @click="handle_vid_647uqdy6do_click">
                  <template #icon><profile-outlined /></template>

                  方案对比
                </a-button>
                <!-- end vid_647uqdy6do 按钮_flajwnvv58 -->
              </al-box>
              <!-- end vid_smwvdp5o43 容器_fvq7lbr6cy -->
            </a-col>
          </a-row>
          <!-- end vid_fpwv36k9re 布局容器_w41tl6sq3p -->
          <!-- begin vid_sys0jtyggj distribution_table -->
          <!-- distribution_table -->
          <a-table
            ref="vid_sys0jtyggj_ref"
            class="vid_sys0jtyggj"
            :totalNumber="vid_sys0jtyggj_props.totalNumber"
            :editRowSaveLoading="vid_sys0jtyggj_props.editRowSaveLoading"
            :sorter="vid_sys0jtyggj_props.sorter"
            :currentRow="vid_sys0jtyggj_props.currentRow"
            :selectedRowList="vid_sys0jtyggj_props.selectedRowList"
            :data-source="vid_sys0jtyggj_options()"
            @change="handle_vid_sys0jtyggj_change"
            :columns="vid_sys0jtyggj_columns"
            :pagination="vid_sys0jtyggj_pagination"
            row-key="id"
            @resizeColumn="(w, col) => handleResizeColumn(w, col, 'vid_sys0jtyggj')"
            :scroll="{ x: 'max-content', scrollToFirstRowOnChange: true, }"
            :row-class-name="(_record, index) => (index % 2 === 1 ? 'table-striped-even' : 'table-striped-odd')"
            :rowSelection="vid_sys0jtyggj_props.rowSelection"
          >
            <template #headerCell="{ title, column }">
              <span :style="textTruncate(column.width)">
                {{ title }}
                <template v-if="column.headerComment">
                  <img
                    v-if="
              column.headerCommentConfig.iconType === 'CUSTOM' ||
              (column.headerCommentConfig.icon &&
                column.headerCommentConfig.icon.indexOf('base64') !== -1)
            "
                    :src="column.headerCommentConfig.icon"
                    style="width: 14px;"
                    alt="icon"
                    :title="column.headerCommentConfig.comment"
                  />
                  <component v-else :is="column.headerCommentConfig.icon" :title="column.headerCommentConfig.comment" />
                </template>
              </span>
            </template>
            <template #bodyCell="{ text, column, record, index }">
              <!-- 操作列 -->
              <div v-if="column.dataIndex === 'vid_sys0jtyggj_operation'" class="operation-cell">
                <!-- 默认分组 -->
                <span>
                  <a-button type="link" @click="handle_vid_sys0jtyggj_clickBtn_wtvwkyuid2(record)">查看</a-button>
                  <a-button type="link" @click="handle_vid_sys0jtyggj_clickBtn_zbg0z5cq4o(record)">导出</a-button>
                  <a-button type="link" @click="handle_vid_sys0jtyggj_clickBtn_zksu2gb5if(record)">删除</a-button>
                </span>
              </div>

              <!-- 序号列 -->
              <template v-if="column && column.dataIndex === 'vid_sys0jtyggj_serialNumber'">
                {{ index + 1 }}
              </template>
              <!-- {"type":"value","dataType":"STRING","link":"","value":"配送方案名称"} 列内容 -->
              <template v-if="column.dataIndex === 'name' && !column.customRender">
                <text-table-cell
                  :rowData="record"
                  :conditionValueMap="vid_sys0jtyggj_props.boundaryValueMap"
                  :dataSource="vid_sys0jtyggj_props.contentDataSource[column.dataIndex]"
                  :columnsConfig="column"
                  :value="text"
                />
              </template>
              <!-- {"type":"value","dataType":"STRING","link":"","value":"优化类型"} 列内容 -->
              <template v-if="column.dataIndex === 'type' && !column.customRender">
                <text-table-cell
                  :rowData="record"
                  :conditionValueMap="vid_sys0jtyggj_props.boundaryValueMap"
                  :dataSource="vid_sys0jtyggj_props.contentDataSource[column.dataIndex]"
                  :columnsConfig="column"
                  :value="text"
                />
              </template>
              <!-- {"type":"value","dataType":"STRING","link":"","value":"袋装总配送量(吨)"} 列内容 -->
              <template v-if="column.dataIndex === 'bagDeliveryQuantity' && !column.customRender">
                <number-table-cell
                  :rowData="record"
                  :conditionValueMap="vid_sys0jtyggj_props.boundaryValueMap"
                  :dataSource="vid_sys0jtyggj_props.contentDataSource[column.dataIndex]"
                  :columnsConfig="column"
                  :value="text"
                />
              </template>
              <!-- {"type":"value","dataType":"STRING","link":"","value":"散装总配送量(吨)"} 列内容 -->
              <template v-if="column.dataIndex === 'bulkDeliveryQuantity' && !column.customRender">
                <number-table-cell
                  :rowData="record"
                  :conditionValueMap="vid_sys0jtyggj_props.boundaryValueMap"
                  :dataSource="vid_sys0jtyggj_props.contentDataSource[column.dataIndex]"
                  :columnsConfig="column"
                  :value="text"
                />
              </template>
              <!-- {"type":"value","dataType":"STRING","link":"","value":"熟料总配送量(吨)"} 列内容 -->
              <template v-if="column.dataIndex === 'grogDeliveryQuantity' && !column.customRender">
                <number-table-cell
                  :rowData="record"
                  :conditionValueMap="vid_sys0jtyggj_props.boundaryValueMap"
                  :dataSource="vid_sys0jtyggj_props.contentDataSource[column.dataIndex]"
                  :columnsConfig="column"
                  :value="text"
                />
              </template>
              <!-- {"type":"value","dataType":"STRING","link":"","value":"运输总费用(元)"} 列内容 -->
              <template v-if="column.dataIndex === 'amount' && !column.customRender">
                <number-table-cell
                  :rowData="record"
                  :conditionValueMap="vid_sys0jtyggj_props.boundaryValueMap"
                  :dataSource="vid_sys0jtyggj_props.contentDataSource[column.dataIndex]"
                  :columnsConfig="column"
                  :value="text"
                />
              </template>
              <!-- {"type":"value","dataType":"STRING","link":"","value":"配送平均单价(元/吨)"} 列内容 -->
              <template v-if="column.dataIndex === 'unitPrice' && !column.customRender">
                <number-table-cell
                  :rowData="record"
                  :conditionValueMap="vid_sys0jtyggj_props.boundaryValueMap"
                  :dataSource="vid_sys0jtyggj_props.contentDataSource[column.dataIndex]"
                  :columnsConfig="column"
                  :value="text"
                />
              </template>
              <!-- {"type":"value","dataType":"STRING","link":"","value":"操作人"} 列内容 -->
              <template v-if="column.dataIndex === 'createdByName' && !column.customRender">
                <text-table-cell
                  :rowData="record"
                  :conditionValueMap="vid_sys0jtyggj_props.boundaryValueMap"
                  :dataSource="vid_sys0jtyggj_props.contentDataSource[column.dataIndex]"
                  :columnsConfig="column"
                  :value="text"
                />
              </template>
              <!-- {"type":"value","dataType":"STRING","link":"","value":"方案生成时间"} 列内容 -->
              <template v-if="column.dataIndex === 'createdDate' && !column.customRender">
                <text-table-cell
                  :rowData="record"
                  :conditionValueMap="vid_sys0jtyggj_props.boundaryValueMap"
                  :dataSource="vid_sys0jtyggj_props.contentDataSource[column.dataIndex]"
                  :columnsConfig="column"
                  :value="text"
                />
              </template>
              <!-- {"type":"value","dataType":"STRING","link":"","value":"ID"} 列内容 -->
              <template v-if="column.dataIndex === 'id' && !column.customRender">
                <text-table-cell
                  :rowData="record"
                  :conditionValueMap="vid_sys0jtyggj_props.boundaryValueMap"
                  :dataSource="vid_sys0jtyggj_props.contentDataSource[column.dataIndex]"
                  :columnsConfig="column"
                  :value="text"
                />
              </template>
            </template>
          </a-table>
          <!-- end vid_sys0jtyggj distribution_table -->
        </al-box>
        <!-- end vid_6dzcjonxof 容器_w5r7gezio8 -->
      </al-box>
      <!-- end vid_map3m5zrof 容器_8ymyg9wo7n -->
    </a-spin>
  </div>
</template>
<script setup>
  import {
      h, ref, reactive, toRaw, markRaw, watch, computed,
      onBeforeMount, onMounted, onBeforeUnmount, onUnmounted, onActivated, onDeactivated
    } from "vue";
    import { useRoute, useRouter } from 'vue-router';
    const router = useRouter();
    const route = useRoute();
    import { get, post, put, del, request, requestWithHeaders } from '@/utils/http/Axios';
    import { cloneDeep, isNullOrEmpty, isEmptyArr, isNullOrUnDef, localGet, isContained, isArray, isEmpty,
      merge, getDifferenceArray, isObject, traversalTreeStructure, checkCaseCondition, renderStringInTemplate, handleBreadcrumbJump, throttle, permission } from '@/utils/index';
    import dayjs from 'dayjs';
    import { getPagePcChartsDataSourceConvert } from '@/utils/chart';
    import { message, notification, Modal } from 'ant-design-vue'
    import { propertyFormatByNumber, propertyFormatByPercentage, propertyFormatByDate } from '@/utils/format';
    /*** PUBLISH_EXEGESIS ***
    import UserTableRecords from '@/model/UserTableRecords';
    *** PUBLISH_EXEGESIS ***/

  // import TextTableCell from '@/components/page/tableCell/text.vue';
  // import NumberTableCell from '@/components/page/tableCell/number.vue';
  // import ProgressTableCell from '@/components/page/tableCell/progress.vue';
  // import OptionsTableCell from '@/components/page/tableCell/options.vue';
  // import DatePickerTableCell from '@/components/page/tableCell/datePicker.vue';
  // import RangePickerTableCell from '@/components/page/tableCell/rangePicker.vue';
  // import RangeNumberTableCell from '@/components/page/tableCell/rangeNumber.vue';
  // import BoolTableCell from '@/components/page/tableCell/bool.vue';

      // 获取传入的流程ID
      const props = defineProps({
        processInstanceId: {
            type: String
        }
      })
      const immediateWatch = (source, callback) => {
        watch(source, callback, {deep: true,immediate: true })
      }



  /* -------------------------- 属性定义 -------------------------- */

      const setTimeOutList = [];
      const pageLoading = reactive({
        loading: false,
        tip: undefined
      });

    const vid_kgqhpv9tb0_props = reactive({
          visible: false,
  })

    const vid_3rzp8k96m3_props = reactive({
          show: false,
      type: "success",
      content: "删除成功",
      duration: 3,
  })

    const vid_2fmud4fowu_props = reactive({
          show: false,
      type: "error",
      content: undefined,
      duration: 3,
  })

    const vid_2ld27fg9p1_props = reactive({
          show: false,
      type: "success",
      content: "上传成功",
      duration: 3,
  })

    const vid_30oaw4n56n_props = reactive({
          show: false,
      type: "error",
      content: "上传失败",
      duration: 3,
  })

    const vid_ocmnae10ai_props = reactive({
          rt_showIcon: true,
  })

    const vid_m8d54ggtsv_props = reactive({
          formModel: {"name":""},
  })

    const vid_mm4tf1nvze_props = reactive({
          value: "",
  })

    const vid_dpvyypxome_props = reactive({
          uploadFile: (data) => request({
            url: '/solution-zjcnfsn-distribution/api/v1/data/import/distribution_compare',
            method:'POST',
            responseType:'blob',
            withCredentials: true,
            data,
            timeout: 360000,
            headers: {},
          }),
      errorMsg: undefined,
      fileList: [],
  })

    const vid_647uqdy6do_props = reactive({
          disabled: true,
  })

    const vid_sys0jtyggj_props = reactive({
          systemSort: [],
      sorter: {},
      editRowSaveLoading: {},
      currentRow: {"name":"","type":"","bagDeliveryQuantity":"","bulkDeliveryQuantity":"","grogDeliveryQuantity":"","amount":"","unitPrice":"","createdByName":"","createdDate":"","id":""},
      selectedRowList: {"unitPrice":[],"createdByName":[],"amount":[],"grogDeliveryQuantity":[],"createdDate":[],"bagDeliveryQuantity":[],"name":[],"bulkDeliveryQuantity":[],"id":[],"type":[]},
      totalNumber: undefined,
      rt_tableConfig: {"basic":{"title":"","rowKey":"id","rowSelection":true,"showSequenceNumber":false,"rowEdit":{"editText":"编辑","saveText":"保存","cancelText":"取消"}},"style":{"headerStyle":{"lintHeight":40,"borderWidth":1,"borderColor":"#D9D9D9","backgroundColor":"#F5F5F5","enableTextStyle":true,"fontFamily":"arial, helvetica, \"microsoft yahei\";","fontSize":14,"textWeight":"600","textColor":"#262626"},"contentStyle":{"lintHeight":40,"borderWidth":1,"borderColor":"#EBEBEB","oddLineBackColor":"#FFFFFF","evenLineBackColor":"#FAFAFA","enableContentStyle":false,"fontFamily":"arial, helvetica, \"microsoft yahei\";","fontSize":14,"textWeight":"400","textColor":"#595959"},"paginationStyle":{"size":"default","layout":"bottomRight"}},"layout":{"operationColumnFixed":"default","showHeader":true,"sticky":false},"scroll":{"x":"max-content","y":"","scrollToFirstRowOnChange":true},"pagination":{"enable":true,"sync":true,"current":1,"pageSize":10,"showSizeChanger":true,"pageSizeOptions":"10,20,30,40","showTotal":true,"showQuickJumper":true,"simple":false,"hideOnSinglePage":false}},
      columnList: [
          {
            id: 'ftmzmnups0',
            dataIndex: 'name',
            headerComment: false,
            title: '配送方案名称',
            ellipsis: false,
            contentAlign: 'left',
            customHeaderCell: () => ({ style: { 'text-align': 'left' } }),
            rowEdit: false,
            rowEditConditions: [],
            contentType: 'TEXT',
            contentConfig: {"conditionStyle":[],"boolConfig":"collection"},
            // 使用插槽的列，设置单元格padding为0，padding样式在内容插槽中已加，以便内容插槽设置背景色时可以占满整个单元格；该样式会在计算属性生成列配置时加入customCell
            customCellStyle: { padding: 0 },
            resizable: true,
          },
          {
            id: 'tbai9fmgnx',
            dataIndex: 'type',
            headerComment: false,
            title: '优化类型',
            ellipsis: false,
            contentAlign: 'left',
            customHeaderCell: () => ({ style: { 'text-align': 'left' } }),
            rowEdit: false,
            rowEditConditions: [],
            contentType: 'TEXT',
            contentConfig: {"conditionStyle":[],"boolConfig":"collection"},
            // 使用插槽的列，设置单元格padding为0，padding样式在内容插槽中已加，以便内容插槽设置背景色时可以占满整个单元格；该样式会在计算属性生成列配置时加入customCell
            customCellStyle: { padding: 0 },
            resizable: true,
          },
          {
            id: 'yrk1azknmw',
            dataIndex: 'bagDeliveryQuantity',
            headerComment: false,
            title: '袋装总配送量(吨)',
            ellipsis: false,
            contentAlign: 'left',
            customHeaderCell: () => ({ style: { 'text-align': 'left' } }),
            rowEdit: false,
            rowEditConditions: [],
            contentType: 'NUMBER',
            contentConfig: {"format":"THOUSANDS_SEPARATOR","conditionStyle":[],"boolConfig":"collection"},
            // 使用插槽的列，设置单元格padding为0，padding样式在内容插槽中已加，以便内容插槽设置背景色时可以占满整个单元格；该样式会在计算属性生成列配置时加入customCell
            customCellStyle: { padding: 0 },
            resizable: true,
          },
          {
            id: '68k17hxj6f',
            dataIndex: 'bulkDeliveryQuantity',
            headerComment: false,
            title: '散装总配送量(吨)',
            ellipsis: false,
            contentAlign: 'left',
            customHeaderCell: () => ({ style: { 'text-align': 'left' } }),
            rowEdit: false,
            rowEditConditions: [],
            contentType: 'NUMBER',
            contentConfig: {"format":"THOUSANDS_SEPARATOR","conditionStyle":[],"boolConfig":"collection"},
            // 使用插槽的列，设置单元格padding为0，padding样式在内容插槽中已加，以便内容插槽设置背景色时可以占满整个单元格；该样式会在计算属性生成列配置时加入customCell
            customCellStyle: { padding: 0 },
            resizable: true,
          },
          {
            id: '0wqk8azz6c',
            dataIndex: 'grogDeliveryQuantity',
            headerComment: false,
            title: '熟料总配送量(吨)',
            ellipsis: false,
            contentAlign: 'left',
            customHeaderCell: () => ({ style: { 'text-align': 'left' } }),
            rowEdit: false,
            rowEditConditions: [],
            contentType: 'NUMBER',
            contentConfig: {"format":"THOUSANDS_SEPARATOR","conditionStyle":[],"boolConfig":"collection"},
            // 使用插槽的列，设置单元格padding为0，padding样式在内容插槽中已加，以便内容插槽设置背景色时可以占满整个单元格；该样式会在计算属性生成列配置时加入customCell
            customCellStyle: { padding: 0 },
            resizable: true,
          },
          {
            id: 'agpvxmj5cf',
            dataIndex: 'amount',
            headerComment: false,
            title: '运输总费用(元)',
            ellipsis: false,
            contentAlign: 'left',
            customHeaderCell: () => ({ style: { 'text-align': 'left' } }),
            rowEdit: false,
            rowEditConditions: [],
            contentType: 'NUMBER',
            contentConfig: {"format":"THOUSANDS_SEPARATOR","conditionStyle":[],"boolConfig":"collection"},
            // 使用插槽的列，设置单元格padding为0，padding样式在内容插槽中已加，以便内容插槽设置背景色时可以占满整个单元格；该样式会在计算属性生成列配置时加入customCell
            customCellStyle: { padding: 0 },
            resizable: true,
          },
          {
            id: 'mc3zlwjnlw',
            dataIndex: 'unitPrice',
            headerComment: false,
            title: '配送平均单价(元/吨)',
            ellipsis: false,
            contentAlign: 'left',
            customHeaderCell: () => ({ style: { 'text-align': 'left' } }),
            rowEdit: false,
            rowEditConditions: [],
            contentType: 'NUMBER',
            contentConfig: {"format":"THOUSANDS_SEPARATOR","conditionStyle":[],"boolConfig":"collection"},
            // 使用插槽的列，设置单元格padding为0，padding样式在内容插槽中已加，以便内容插槽设置背景色时可以占满整个单元格；该样式会在计算属性生成列配置时加入customCell
            customCellStyle: { padding: 0 },
            resizable: true,
          },
          {
            id: 'smtugan6cv',
            dataIndex: 'createdByName',
            headerComment: false,
            title: '操作人',
            ellipsis: false,
            contentAlign: 'left',
            customHeaderCell: () => ({ style: { 'text-align': 'left' } }),
            rowEdit: false,
            rowEditConditions: [],
            contentType: 'TEXT',
            contentConfig: {"conditionStyle":[],"boolConfig":"collection"},
            // 使用插槽的列，设置单元格padding为0，padding样式在内容插槽中已加，以便内容插槽设置背景色时可以占满整个单元格；该样式会在计算属性生成列配置时加入customCell
            customCellStyle: { padding: 0 },
            resizable: true,
          },
          {
            id: '5ongtk7ce1',
            dataIndex: 'createdDate',
            headerComment: false,
            title: '方案生成时间',
            ellipsis: false,
            contentAlign: 'left',
            customHeaderCell: () => ({ style: { 'text-align': 'left' } }),
            rowEdit: false,
            rowEditConditions: [],
            contentType: 'TEXT',
            contentConfig: {"conditionStyle":[],"boolConfig":"collection"},
            // 使用插槽的列，设置单元格padding为0，padding样式在内容插槽中已加，以便内容插槽设置背景色时可以占满整个单元格；该样式会在计算属性生成列配置时加入customCell
            customCellStyle: { padding: 0 },
            resizable: true,
          },
          {
            dataIndex: 'vid_sys0jtyggj_operation',
            title: '操作',
          },
        ],
      rawColumnList: [],
      // 进行行合并所需的排序规则，必须将其加到排序字段的前面，以实现合并单元格
      rowMergeSort: [],
      // 完整的排序规则：需要将行合并的排序规则和排序字段的排序规则赋给该属性；调接口时会使用其作为排序条件
      systemSort: [],
      // 条件格式需要的边界值映射：key为边界值id，value为边界值数据
      boundaryValueMap: {},
      // 表格单元格内容渲染需要的外部数据源：key为列，value为该列单元格的外部数据源配置
      contentDataSource: {},
      // 选中表格行的配置
      rowSelection: {
        onChange(selectedRowKeys, selectedRows) {
          // 清空之前选中行的信息
          for (const key in vid_sys0jtyggj_props.selectedRowList) {
            vid_sys0jtyggj_props.selectedRowList[key] = [];
          }
          // 将新选中行的信息加入selectedRowList
          selectedRows.forEach(record => {
            // 将当前行的相关信息加入到选中行数据中
            for (const key in vid_sys0jtyggj_props.selectedRowList) {
              vid_sys0jtyggj_props.selectedRowList[key].push(record[key]);
            }
          });
        },
      },
  })
  // ---------------------------- 定义模型数据 ----------------------------

    const r_rg3lk1tq6l = reactive({"name":""})

    // ============================ 定义模型数据 ============================


    const r_rg3lk1tq6l_rules = reactive({

    })


      // 处理校验
      const setSubFormName =(parentInfo, name)=>{
        return [parentInfo.parents, parentInfo.cycleIndex, name];
      }


    const vid_sys0jtyggj_options_raw = ref([])

      const vid_sys0jtyggj_options = computed(() => {
        return () => vid_sys0jtyggj_options_raw.value
      })

  // 图表组件 distribution_table 条件格式数据依赖
  const vid_sys0jtyggj_chartConditionDependencyMap = ref({
  })
  /* ========================== 属性定义 ========================== */


  /* -------------------------- 元素数据引用 -------------------------- */
  // 组件 表单容器_4n7fy0jwrt ref 的引用
  const vid_m8d54ggtsv_ref = ref(null);
  // 组件 distribution_table ref 的引用
  const vid_sys0jtyggj_ref = ref(null);

  /* ========================== 元素数据引用 ========================== */


  /* -------------------------- 页面数据 -------------------------- */

    // 页面数据 搜索配送优化方案
    const dataConnector_conn_9y6o0hksph_response = ref();
    const dataConnector_conn_9y6o0hksph = async (additionParams = {}) => {
        const exec = async () => {

          // 获取参数
          const params = {
            filter: {},
          pageNo: vid_sys0jtyggj_props?.rt_tableConfig.pagination.current,
          pageSize: vid_sys0jtyggj_props?.rt_tableConfig.pagination.pageSize
          };
          params.filter.name = r_rg3lk1tq6l.name;
          // 注入附加的参数
          try {
            merge(params, additionParams);
          } catch (error) {
            console.log(error)
          }
          // 判断加载提示

          // 处理URL
          let url = '/solution-zjcnfsn-distribution/api/v1/distribution/search';
          // 替换url中的变量

          // 排除空参数  日期组件重置后的空参数是[null] 或者[undefined]
          Object.keys(params).forEach(key=>{ if(params[key] === null){ delete params[key] }else if( Object.prototype.toString.call(params[key]) === '[object Object]' ){ Object.keys(params[key]).forEach(childKey=>{ if(params[key][childKey] === null || (Array.isArray(params[key][childKey]) && params[key][childKey].length === 1 && isNullOrUnDef(params[key][childKey]?.[0]))){ delete params[key][childKey] }}) } });
          return post(url, params).then(async (resp) => {
            dataConnector_conn_9y6o0hksph_response.value = resp;

            return resp;
          }).catch(async (e) => {


            return Promise.reject(e);
          }).finally(async () => {


          })
        }

          return await exec()

    }


    // 页面数据 删除配送优化方案
    const dataConnector_conn_cm7rc0ya3s_response = ref();
    const dataConnector_conn_cm7rc0ya3s = async (additionParams = {}) => {
        const exec = async () => {

          // 获取参数
          const params = {

          };

          // 注入附加的参数
          try {
            merge(params, additionParams);
          } catch (error) {
            console.log(error)
          }
          // 判断加载提示

          // 处理URL
          let url = '/solution-zjcnfsn-distribution/api/v1/distribution/{id}';
          // 替换url中的变量
          url = url.replace('{id}', String(vid_sys0jtyggj_props?.currentRow.id))
          // 排除空参数  日期组件重置后的空参数是[null] 或者[undefined]
          Object.keys(params).forEach(key=>{ if(params[key] === null){ delete params[key] }else if( Object.prototype.toString.call(params[key]) === '[object Object]' ){ Object.keys(params[key]).forEach(childKey=>{ if(params[key][childKey] === null || (Array.isArray(params[key][childKey]) && params[key][childKey].length === 1 && isNullOrUnDef(params[key][childKey]?.[0]))){ delete params[key][childKey] }}) } });
          return del(url, {data: params}).then(async (resp) => {
            dataConnector_conn_cm7rc0ya3s_response.value = resp;

            return resp;
          }).catch(async (e) => {


            return Promise.reject(e);
          }).finally(async () => {

            response_951e8a6vak()
          })
        }

          return await exec()

    }

  /* ========================== 页面数据 ========================== */


  /* -------------------------- 响应 -------------------------- */

    // 页面交互 方案删除后交互
    const response_951e8a6vak = async () => {

    const branchList = [{
          conditionType: 'EQUALS',
          value: 'success',
          exec: async () => {
              vid_kgqhpv9tb0_props.visible = false;
  await dataConnector_conn_9y6o0hksph()
  vid_3rzp8k96m3_props.show = true;
          }
      },{
          conditionType: 'EQUALS',
          value: 'failure',
          exec: async () => {
              vid_2fmud4fowu_props.show = true;
          }
      }];

    const matchBranch = branchList.find(item => checkCaseCondition(dataConnector_conn_cm7rc0ya3s_response?.value?.status, item.conditionType, item.value));
    // 匹配到的分支
    if (matchBranch) {
      matchBranch.exec();
      return;
    }
    // 默认分支动作


    }


    // 页面交互 跳转详情
    const response_0666i3xm38 = async () => {

    const query = {
      id: vid_sys0jtyggj_props?.currentRow.id
    };
    const jumpInfo = {
      path: '/app_50000089/page/50001039', // 跳转地址
      query
    };
    const routeUrl = router.resolve(jumpInfo);
    let url = routeUrl.href;
    // 判断是否是MicroApp的子应用
    const microAppData = window.__MICRO_APP_ENVIRONMENT__ || window.eventCenterForViteApp?.getData();
    if (microAppData) {
      const urlList = []
      Object.keys(jumpInfo.query).forEach(item=>{
        urlList.push(item + '=' + jumpInfo.query[item]);
      })
      // 判断要跳转的地址是否是用户自定义输入的
      const customJumpPath = jumpInfo.path;

      // 自定义跳转页面不是其他平台的菜单，则直接使用全路径
       if (customJumpPath.indexOf('/allin-app/') !== -1) {
        // 目标页面是其他平台的菜单
        let jumpPath = customJumpPath.substring(customJumpPath.indexOf('/allin-app/'));
        // 配置有参数，需要加参数添加到路由后面
        if(urlList.length) {
          // 跳转的路径本身带有参数
          if(jumpPath.indexOf('?') !== -1) {
            jumpPath += '&' + urlList.join("&");
          } else {
            jumpPath += '?'+ urlList.join("&");
          }
        }
        url = location.origin + jumpPath;
      } else {
        // 目标页面就是低代码项目本身的页面
        if(location.href.indexOf('/allin-app/') > -1) {
          url = location.origin + location.pathname.split("/allin-app/").shift() + '/allin-app'+ url;
        } else {
          url = location.origin + '/allin-app'+ url;
        }
      }
    }
    // 打开新窗口

      if (microAppData) {
        window.location.href = url;
      } else {
        router.push(jumpInfo);
      }


    }


    // 页面交互 创建方案跳转
    const response_taa6a8fr51 = async () => {

    const query = {

    };
    const jumpInfo = {
      path: '/app_50000089/page/50001018', // 跳转地址
      query
    };
    const routeUrl = router.resolve(jumpInfo);
    let url = routeUrl.href;
    // 判断是否是MicroApp的子应用
    const microAppData = window.__MICRO_APP_ENVIRONMENT__ || window.eventCenterForViteApp?.getData();
    if (microAppData) {
      const urlList = []
      Object.keys(jumpInfo.query).forEach(item=>{
        urlList.push(item + '=' + jumpInfo.query[item]);
      })
      // 判断要跳转的地址是否是用户自定义输入的
      const customJumpPath = jumpInfo.path;

      // 自定义跳转页面不是其他平台的菜单，则直接使用全路径
       if (customJumpPath.indexOf('/allin-app/') !== -1) {
        // 目标页面是其他平台的菜单
        let jumpPath = customJumpPath.substring(customJumpPath.indexOf('/allin-app/'));
        // 配置有参数，需要加参数添加到路由后面
        if(urlList.length) {
          // 跳转的路径本身带有参数
          if(jumpPath.indexOf('?') !== -1) {
            jumpPath += '&' + urlList.join("&");
          } else {
            jumpPath += '?'+ urlList.join("&");
          }
        }
        url = location.origin + jumpPath;
      } else {
        // 目标页面就是低代码项目本身的页面
        if(location.href.indexOf('/allin-app/') > -1) {
          url = location.origin + location.pathname.split("/allin-app/").shift() + '/allin-app'+ url;
        } else {
          url = location.origin + '/allin-app'+ url;
        }
      }
    }
    // 打开新窗口

      if (microAppData) {
        window.location.href = url;
      } else {
        router.push(jumpInfo);
      }


    }

  /* ========================== 响应 ========================== */


  /* -------------------------- 函数 -------------------------- */

    // 自定义函数 exportData
    const customFunction_pibrc95jb8 = async (...params) => {
      function downloadExcel(response, name) {
    const blob = new Blob(
      [response], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' });
    const downloadElement = document.createElement('a');
    const href = window.URL.createObjectURL(blob);// 创建下载的链接
    downloadElement.href = href;
    downloadElement.download = name; // 下载后文件名
    document.body.appendChild(downloadElement);
    downloadElement.click(); // 点击下载
    document.body.removeChild(downloadElement); // 下载完成移除元素
    window.URL.revokeObjectURL(href);
    return href;
  }


  const exec = async () => {

    // 处理URL
    let url = '/solution-zjcnfsn-distribution/api/v1/distribution/{id}/export';
    // 替换url中的变量
    url = url.replace('{id}', String(vid_sys0jtyggj_props?.currentRow.id))
    let name = vid_sys0jtyggj_props?.currentRow.name
    return get(url, {}, {responseType: 'arraybuffer'}).then(res => {
      if(res.data) {
      downloadExcel(res.data, name + '.xlsx')
  } else {
      downloadExcel(res, name + '.xlsx')
  }
    }).catch(async (e) => {
      return Promise.reject(e);
    }).finally(async () => {
    })
  }

  await exec()

    }


    // 自定义函数 jumpDiff
    const customFunction_vmonarxuqw =  (...params) => {
            router.push({
        	path: '/app_50000089/page/3000000170',
        	query: {
        		optimizeDistributionId: vid_sys0jtyggj_props.selectedRowList.id[0],
      		manualDistributionId: vid_sys0jtyggj_props.selectedRowList.id[1]
        	}
        })
    }


    // 自定义函数 下载模板
    const customFunction_o4fdwt5kas = async (...params) => {
      function downloadExcel(response, name) {
    const blob = new Blob([response], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' });
    const downloadElement = document.createElement('a');
    const href = window.URL.createObjectURL(blob);// 创建下载的链接
    downloadElement.href = href;
    downloadElement.download = name; // 下载后文件名
    document.body.appendChild(downloadElement);
    downloadElement.click(); // 点击下载
    document.body.removeChild(downloadElement); // 下载完成移除元素
    window.URL.revokeObjectURL(href);
    return href;
  }

  get(`/solution-zjcnfsn-distribution/api/v1/template/download/distribution_compare`,null,{responseType: 'arraybuffer'}).then(res => {
  if(res.data) {
      downloadExcel(res.data, '配送方案.xlsx')
  } else {
      downloadExcel(res, '配送方案.xlsx')
  }
  })
    }

  /* ========================== 函数 ========================== */


  /* -------------------------- 页面参数 -------------------------- */

    const pageParameter_state = reactive({
        'processInstanceId': props.processInstanceId,
    })

  /* ========================== 页面参数 ========================== */


  /* -------------------------- 组件事件处理方法 -------------------------- */

    // ---------------------------- 组件数据同步 ----------------------------
    // 处理 删除失败全局提示_meoci57xlw 的 content 属性关联
  watch(() => dataConnector_conn_cm7rc0ya3s_response?.value?.errorMsg,
    () => { vid_2fmud4fowu_props.content = dataConnector_conn_cm7rc0ya3s_response?.value?.errorMsg; },
    {deep: true})
  // 处理 distribution_table 的 systemList 属性关联
  watch(() => dataConnector_conn_9y6o0hksph_response?.value?.data?.content,
    () => { vid_sys0jtyggj_options_raw.value = dataConnector_conn_9y6o0hksph_response?.value?.data?.content; },
    {deep: true})
  // 处理 distribution_table 的 totalNumber 属性关联
  watch(() => dataConnector_conn_9y6o0hksph_response?.value?.data?.totalElements,
    () => { vid_sys0jtyggj_props.totalNumber = dataConnector_conn_9y6o0hksph_response?.value?.data?.totalElements; },
    {deep: true})
    // ============================ 组件数据同步 ============================

  /**
  * 处理元素 对话框 的 cancel 事件
  */
  let handle_vid_kgqhpv9tb0_cancel = throttle(async (...params) => {
  vid_kgqhpv9tb0_props.visible = false;
  }, 500)
  /**
  * 处理元素 对话框 的 ok 事件
  */
  let handle_vid_kgqhpv9tb0_ok = throttle(async (...params) => {
  await dataConnector_conn_cm7rc0ya3s()
  response_951e8a6vak()
  }, 500)
  /**
  * 处理元素 按钮 的 click 事件
  */
  let handle_vid_kixb6r8oe1_click = throttle(async (...params) => {
  // 重置表格 distribution_table(vid_sys0jtyggj) 的页码
  if (
  vid_sys0jtyggj_props?.rt_tableConfig?.pagination &&
  vid_sys0jtyggj_props.rt_tableConfig?.pagination.hasOwnProperty('current')
  ) {
  vid_sys0jtyggj_props.rt_tableConfig.pagination.current = 1
  }
  await dataConnector_conn_9y6o0hksph()
  }, 500)
  /**
  * 处理元素 按钮 的 click 事件
  */
  let handle_vid_92fg79r9vi_click = throttle(async (...params) => {
  // 这里组件可能还未初始化， 这里使用可选链的形式进行函数触发
  try {
  await vid_m8d54ggtsv_ref.value?.resetFields();
  } catch (error) { console.log(error);}
  // 重置表格 distribution_table(vid_sys0jtyggj) 的页码
  if (
  vid_sys0jtyggj_props?.rt_tableConfig?.pagination &&
  vid_sys0jtyggj_props.rt_tableConfig?.pagination.hasOwnProperty('current')
  ) {
  vid_sys0jtyggj_props.rt_tableConfig.pagination.current = 1
  }
  await dataConnector_conn_9y6o0hksph()
  }, 500)
  /**
  * 处理元素 按钮 的 click 事件
  */
  let handle_vid_3beahpfrj3_click = throttle(async (...params) => {
  await customFunction_o4fdwt5kas();
  }, 500)
  /**
  * 处理元素 按钮 的 click 事件
  */
  let handle_vid_vk9gw8xwnc_click = throttle(async (...params) => {
  response_taa6a8fr51()
  }, 500)
  /**
  * 处理元素 文件上传 的 uploadSuccess 事件
  */
  let handle_vid_dpvyypxome_uploadSuccess = throttle(async (...params) => {
  vid_2ld27fg9p1_props.show = true;
  // 重置表格 distribution_table(vid_sys0jtyggj) 的页码
  if (
  vid_sys0jtyggj_props?.rt_tableConfig?.pagination &&
  vid_sys0jtyggj_props.rt_tableConfig?.pagination.hasOwnProperty('current')
  ) {
  vid_sys0jtyggj_props.rt_tableConfig.pagination.current = 1
  }
  await dataConnector_conn_9y6o0hksph()
  }, 500)
  /**
  * 处理元素 文件上传 的 uploadFailed 事件
  */
  let handle_vid_dpvyypxome_uploadFailed = throttle(async (...params) => {
  const [errorMsg] = params;
  vid_dpvyypxome_props.errorMsg = errorMsg;
  vid_30oaw4n56n_props.show = true;
  }, 500)
  /**
  * 处理元素 按钮 的 click 事件
  */
  let handle_vid_647uqdy6do_click = throttle(async (...params) => {
  customFunction_vmonarxuqw();
  }, 500)
  /**
  * 处理元素 表格 的 clickBtn_zksu2gb5if 事件
  */
  let handle_vid_sys0jtyggj_clickBtn_zksu2gb5if = throttle(async (...params) => {
  // 存储表格当前行数据
  const [record] = params;
  vid_sys0jtyggj_props.currentRow = record;
  vid_kgqhpv9tb0_props.visible = true;
  }, 500)
  /**
  * 处理元素 表格 的 clickBtn_zbg0z5cq4o 事件
  */
  let handle_vid_sys0jtyggj_clickBtn_zbg0z5cq4o = throttle(async (...params) => {
  // 存储表格当前行数据
  const [record] = params;
  vid_sys0jtyggj_props.currentRow = record;
  await customFunction_pibrc95jb8();
  }, 500)
  /**
  * 处理元素 表格 的 change 事件
  */
  let handle_vid_sys0jtyggj_change = throttle(async (...params) => {
  // 处理分页器相关数据
  const [pagination, filters, sorter] = params;
  const { current, pageSize } = pagination;
  vid_sys0jtyggj_props.rt_tableConfig.pagination.current = current;
  vid_sys0jtyggj_props.rt_tableConfig.pagination.pageSize = pageSize;
  // 处理排序相关数据
  const { field, order } = sorter;
  const sorterList = [...vid_sys0jtyggj_props.rowMergeSort];
  let sorterValue = {};
  if (order === 'descend') {
  sorterValue = { order: field, direction: 'DESC' }
  } else if (order === 'ascend') {
  sorterValue = { order: field, direction: 'ASC' }
  }
  sorterList.push(sorterValue);
  vid_sys0jtyggj_props.systemSort = sorterList;
  vid_sys0jtyggj_props.sorter = sorterValue;
  await dataConnector_conn_9y6o0hksph()
  }, 500)
  /**
  * 处理元素 表格 的 clickBtn_wtvwkyuid2 事件
  */
  let handle_vid_sys0jtyggj_clickBtn_wtvwkyuid2 = throttle(async (...params) => {
  // 存储表格当前行数据
  const [record] = params;
  vid_sys0jtyggj_props.currentRow = record;
  response_0666i3xm38()
  }, 500)
  /* ========================== 组件事件处理方法 ========================== */


  /* -------------------------- 生命周期 -------------------------- */
  onMounted(() => {dataConnector_conn_9y6o0hksph()

    });

    onUnmounted(() => {
      // 销毁定时器
      setTimeOutList.forEach(({ repeat, timer }) => {
        repeat ?  clearInterval(timer): clearTimeout(timer);
      });
    });

  /* ========================== 生命周期 ========================== */


  /* -------------------------- 数据关联处理 -------------------------- */

      // 处理 删除成功全局提示_7u0ncyeoam 全局消息
        immediateWatch(
            () => vid_3rzp8k96m3_props.show,
            () => {
                if (vid_3rzp8k96m3_props.show) {
                    message[vid_3rzp8k96m3_props.type](vid_3rzp8k96m3_props.content, vid_3rzp8k96m3_props.duration, () => {
                        vid_3rzp8k96m3_props.show = false
                    })
                }
            }
        )
  // 处理 删除失败全局提示_meoci57xlw 全局消息
        immediateWatch(
            () => vid_2fmud4fowu_props.show,
            () => {
                if (vid_2fmud4fowu_props.show) {
                    message[vid_2fmud4fowu_props.type](vid_2fmud4fowu_props.content, vid_2fmud4fowu_props.duration, () => {
                        vid_2fmud4fowu_props.show = false
                    })
                }
            }
        )
  // 处理 上传成功全局提示_k4skajk36l 全局消息
        immediateWatch(
            () => vid_2ld27fg9p1_props.show,
            () => {
                if (vid_2ld27fg9p1_props.show) {
                    message[vid_2ld27fg9p1_props.type](vid_2ld27fg9p1_props.content, vid_2ld27fg9p1_props.duration, () => {
                        vid_2ld27fg9p1_props.show = false
                    })
                }
            }
        )
  // 处理 上传失败全局提示_v39esmre07 全局消息
        immediateWatch(
            () => vid_30oaw4n56n_props.show,
            () => {
                if (vid_30oaw4n56n_props.show) {
                    message[vid_30oaw4n56n_props.type](vid_30oaw4n56n_props.content, vid_30oaw4n56n_props.duration, () => {
                        vid_30oaw4n56n_props.show = false
                    })
                }
            }
        )



  /* -------------------------- 表单数据同步 -------------------------- */
  /* ========================== 表单数据同步 ========================== */

  /* ========================== 数据关联处理 ========================== */


  /* -------------------------- 不同组件自定义的处理逻辑 -------------------------- */
  const vid_ocmnae10ai_props_tabConfig = computed(() => {
   const initValue = [{"parameter":[],"icon":"","title":"配送优化","applicationId":50000089,"key":"tab1","targetPage":{"customUrl":"","settingType":""},"query":{}},{"parameter":[],"icon":"","title":"配送方案管理","applicationId":50000089,"key":"tab2","targetPage":{"customUrl":"","settingType":""},"query":{}}];
  return initValue;
  })
  onMounted(() => {
    const rawColumnList = []
    traversalTreeStructure(vid_sys0jtyggj_props.columnList, (node) => {
      if (node.type === 'column') {
        rawColumnList.push(node)
      }
    });
    /*** PUBLISH_EXEGESIS ***
    // 获取缓存的表格列宽度，处理列宽信息
    UserTableRecords.getTableRecords(localGet('al__UID')).then((res) => {
      const columnWidthMap = res['vid_sys0jtyggj'] ?? {};
      rawColumnList.map((column) => {
        if(columnWidthMap[column.dataIndex]) {
          column.width = columnWidthMap[column.dataIndex]
        }
      })
    });
    *** PUBLISH_EXEGESIS ***/
    vid_sys0jtyggj_props.rawColumnList = rawColumnList;
  })
  // 生成表格列：相同分组的数据需要合并单元格
  const vid_sys0jtyggj_columns = computed(() => {
    // 需要合并单元格的列
    const groupKeys = [];

    // 将表头配置按照groupTitle字段进行分组，以实现多级表头
    const columnList = [...vid_sys0jtyggj_props.columnList];

    function formatColumns(columns) {
      columns.forEach(item => {
        const { dataIndex, contentAlign, children, customCellStyle } = item;
        // 如果当前列是分组列，则递归处理它的子列，当前列本身不作处理
        if (!dataIndex && children && children.length) {
          formatColumns(children);
          return;
        }

        const groupIndex = groupKeys.findIndex(item => item === dataIndex);
        // 如果当前字段属于分组字段，则给它添加合并单元格的配置，否则直接返回
        if (groupIndex === -1) {
          item.customCell = (record, index) => {
            return { style: { 'text-align': contentAlign, ...(customCellStyle || {}) } };
          };
        } else {
          item.customCell = (record, index) => {
            const rowGroupKeys = groupKeys.slice(0, groupIndex + 1);
            const rowSpanList = generateRowSpanList(vid_sys0jtyggj_options.value(), rowGroupKeys,vid_sys0jtyggj_props.editRecordMap);
            return { rowSpan: rowSpanList[index], style: { 'text-align': contentAlign, ...(customCellStyle || {}) } };
          };
        }
      })
    }

    // 格式化column：增加合并单元格的配置，以及自定义样式
    formatColumns(columnList);

    return columnList;
  });


    // 表格分页器信息：将总条数信息加到基础分页信息中
    const vid_sys0jtyggj_pagination = computed(() => {
      const { totalNumber, rt_tableConfig } = vid_sys0jtyggj_props;
      const {
        enable = true,
        current= 1,
        pageSize= 10,
        showSizeChanger= false,
        pageSizeOptions= '10,20,30,40',
        showTotal= false,
        showQuickJumper= false,
        simple= false,
        hideOnSinglePage= false,
      } = rt_tableConfig.pagination ?? {};
      const { size = 'default', layout='bottomRight' } = rt_tableConfig?.style?.paginationStyle || {}
      let info = {};
      if(enable) {
        info = {
          total: totalNumber || 0,
          pageSize,
          size,
          simple,
          current,
          showSizeChanger,
          pageSizeOptions: pageSizeOptions.split(','),
          showQuickJumper,
          hideOnSinglePage,
          position: [layout],
        }
        if(showTotal) {
          info.showTotal = (total, range) => `共${total}个项目，第${current}/${Math.ceil(total / pageSize)}页`
        }
        return info;
      }
      return false;
    })


        // 补充一个watch，用于监听删除最后一页最后一条数据的情况，然后重新加载数据
        watch(() => dataConnector_conn_9y6o0hksph_response?.value?.data?.content, (newValue) => {
          const current = vid_sys0jtyggj_props.rt_tableConfig.pagination.current;
          if (!newValue?.length && current > 1) {
            vid_sys0jtyggj_props.rt_tableConfig.pagination.current = current - 1;
            dataConnector_conn_9y6o0hksph();
          }
        });
  /**
   * 生成分组字段合并单元格的配置：返回值为一个数字数组，数组里面每一项即为该字段当前行的rowSpan配置
   * @param {Array} 表格中的数据
   * @param {Array} 当前分组字段的列表，注：为了保证优先级低的字段合并后是优先级高的字段合并后的子集，需要把比该字段优先级高的分组字段按顺序放在该字段前面；例如：所有分组字段列表为['grade', 'age', 'score']，要生成age字段的合并单元格配置，则该参数需要传['grade', 'age']
   * @returns {Array} 该字段合并单元格的rowSpan配置，例：[1, 1, 2, 0, 1]
   */
  function generateRowSpanList(dataSource, groupKeys,editRecordMap) {
    if (!dataSource || !dataSource.length) {
      return [];
    }

    const rowSpanList = [];

    // 判断单元格是否需要合并的临时值：使用表格数据最后一行进行初始化（表格数据的遍历是倒序进行的）
    let tempValue = getGroupValue(dataSource[dataSource.length - 1], groupKeys);
    // 记录需要合并单元格的数量
    let tempValueCount = 0;

    // 倒序遍历数组，以保证使用最前面一条数据合并单元格
    for (let index = dataSource.length - 1; index >= 0; index--) {
      rowSpanList[index] = 0;
      const groupValue = getGroupValue(dataSource[index], groupKeys);
      // 如果当前行的分组数据跟上一行一致，则将标记数量加一；否则将标记数量的当前值赋给上一条数据，并重置临时值和标记数量
      if(editRecordMap && editRecordMap[index]){ //如果当前行是编辑行
        rowSpanList[index + 1] = tempValueCount;
        tempValue = "";
        tempValueCount=1;
      }
      else if (groupValue === tempValue) {
        tempValueCount++;
      } else {
        rowSpanList[index + 1] = tempValueCount;
        tempValue = groupValue;
        tempValueCount = 1;
      }

      // 遍历到最后一行，将当前的标记数量赋给当前行
      if (index === 0) {
        rowSpanList[index] = tempValueCount;
      }
    }

    return rowSpanList;
  }

  /**
   * 根据分组字段列表生成当前数据行的分组值
   * @param {Object} 当前数据行
   * @param {Array} 分组字段列表
   * @returns {String} 拼装的当前数据行的分组值，例：record为{ age: 7, grade: '一年级', name: '小赵' }，groupKeys为['grade', 'age']，则拼装后的返回值为'一年级__$__7'
   */
  function getGroupValue(record, groupKeys) {
    const groupValueList = [];
    groupKeys.forEach(groupKey => {
      groupValueList.push(`${record[groupKey]}`);
    });

    return groupValueList.join('__$__');
  }

  // 生成过长省略的样式
  function textTruncate(width){
    if (!width) {
      return {};
    }
    return {
      whiteSpace: 'nowrap',
      overflow: 'hidden',
      textOverflow: 'ellipsis',
      display: 'inline-block',
      width:  typeof(width) === 'number' ? width + 'px' : width
    }
  }

  /**
   * 将列表数据转换成树状数据
   * @param {Array} 原始的列表数据
   * @param {String|Number} 列表数据的唯一key
   * @param {String|Number} 列表数据转成树时的父级id
  */
  function convertListToTree(list, key, parentKey) {
    const clonedList = cloneDeep(list || []);

    // 遍历列表数据，生成树节点的map：key为列表数据的唯一key，value为列表当前行的数据
    const treeNodeMap = {};
    clonedList.forEach(item => {
      treeNodeMap[item[key]] = item;
    });

    const treeDataList = [];
    clonedList.forEach(item => {
      // 如果当前行数据的父级id不在树节点的map中，则当前数据为根节点数据，将其加入最终树形数据的列表；否则将其放入其父节点数据的children中
      if (!treeNodeMap[item[parentKey]]) {
        treeDataList.push(item);
      } else {
        if (!treeNodeMap[item[parentKey]].children) {
          treeNodeMap[item[parentKey]].children = [];
        }
        treeNodeMap[item[parentKey]].children.push(item);
      }
    });

    return treeDataList;
  }

  /**
   * 表格列宽伸缩处理，使用indexedDB缓存伸缩后的列宽度
   */
  const handleResizeColumn = (w, col, vid) => {
    col.width = w;
    /*** PUBLISH_EXEGESIS ***
    UserTableRecords.saveTableRecords(col, localGet('al__UID'), vid)
    *** PUBLISH_EXEGESIS ***/
  }
  /* ========================== 不同组件自定义的处理逻辑 ========================== */


  // ================================定制化逻辑========================================

  watch(
          () => vid_sys0jtyggj_props.selectedRowList.id.length,
          (newVal) => {
              if(newVal === 2) {
                  vid_647uqdy6do_props.disabled = false
              } else {
                  vid_647uqdy6do_props.disabled = true
              }
          }
      )
      vid_sys0jtyggj_props.rowSelection = {
          hideSelectAll: true,
          onChange(selectedRowKeys, selectedRows) {
              // 清空之前选中行的信息
              for (const key in vid_sys0jtyggj_props.selectedRowList) {
                vid_sys0jtyggj_props.selectedRowList[key] = [];
              }
              // 将新选中行的信息加入selectedRowList
              selectedRows.forEach(record => {
                // 将当前行的相关信息加入到选中行数据中
                for (const key in vid_sys0jtyggj_props.selectedRowList) {
                  vid_sys0jtyggj_props.selectedRowList[key].push(record[key]);
                }
              });
            },
      }




      onMounted(()=>{
        let outDiv = document.querySelector('.ant3-upload')
if (outDiv) {
    console.log(outDiv);
    let secondDiv = outDiv.querySelector('.ant3-upload');
    console.log(secondDiv, 'secondDiv')
    if (secondDiv) {
        let thirdDiv = secondDiv.querySelector('.al-upload-button');
        console.log(thirdDiv);
        if (thirdDiv) {
            let fourthDiv = thirdDiv.querySelector('span')
            console.log(fourthDiv, 'fourthDiv')
            if (fourthDiv) {
                fourthDiv.style.display = 'none'
            }
        }
    }
}
 
 })
</script>
<style lang="less" scoped>
  .page_root {
  width: 100%;
  height: 100%;
  overflow: auto;
  }
  .page_root :deep(.@{ant-prefix}-spin-nested-loading),
  .page_root :deep(.@{ant-prefix}-spin-container)
   {
      height: 100%;
  }
  .table-moreBtn_down {
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 100px;
  }

  .table-moreBtn_menu :deep(.table-moreBtn_menu-item):hover {
    background: #ebf1ff;
  }

  /*  表格树结构样式处理，展开按钮层级增加*/
  :deep(.@{ant-prefix}-table-row-expand-icon) {
    z-index: 1;
  }
  /*  表格树结构 由于每个表格项采用自定义组件，使用绝对定位布局，开启树结构导致显示异常，暂时使用层级定位位置 */
  :deep(.@{ant-prefix}-table-row-level-1 .@{ant-prefix}-table-cell-with-append .cell-wrapper-left) {
    left: 15px !important;
    width: calc(100% - 15px);
  }
  :deep(.@{ant-prefix}-table-row-level-2 .@{ant-prefix}-table-cell-with-append .cell-wrapper-left) {
    left: 30px !important;
    width: calc(100% - 30px);
  }
  :deep(.@{ant-prefix}-table-row-level-3 .@{ant-prefix}-table-cell-with-append .cell-wrapper-left) {
    left: 45px !important;
    width: calc(100% - 45px);
  }
  :deep(.@{ant-prefix}-table-row-level-4 .@{ant-prefix}-table-cell-with-append .cell-wrapper-left) {
    left: 60px !important;
    width: calc(100% - 60px);
  }

  /* 穿梭框改变默认样式，为根据组件样式控制左右栏宽度。 */
  :deep(.@{ant-prefix}-transfer-list)
   {
      height: 100%;
      width: 50%;
  }
  .vid_ocmnae10ai :deep(a) {
        color: undefined;
      }
      :deep(.vid_ocmnae10ai.@{ant-prefix}-breadcrumb) > span:last-child a {
        color: undefined;
        opacity: 0.75;
      }
  .vid_ocmnae10ai{
      height:40px;
      display:flex;
      align-items:center;
      flex-wrap:undefined;
      margin-bottom:16px;
      padding-left:24px;
      background-color:rgba(255, 255, 255, 1)
  }
  .vid_map3m5zrof{
      display:flex;
      flex-direction:column;
      flex-wrap:undefined;
      padding-right:24px;
      padding-left:24px;
      background-color:rgba(255, 255, 255, 0)
  }
  .vid_m8d54ggtsv{
      width:100%;
      background-color:rgba(255, 255, 255, 1);
      border-radius:4px
  }
  .vid_83xfputcbw{
      margin-top:16px;
      padding-right:16px;
      padding-left:16px
  }
  .vid_pfitccaasx{
      display:flex;
      flex-direction:row;
      justify-content:flex-start;
      flex-wrap:undefined
  }
  .vid_kixb6r8oe1{
      margin-right:16px;
      background-color:rgba(215, 0, 15, 1);
      border-style:solid;
      border-width:1px;
      border-color:#D7000F;
      border-radius:2px
  }
  .vid_92fg79r9vi{
      margin-right:16px;
      color:rgba(215, 0, 15, 1);
      border-style:solid;
      border-width:1px;
      border-color:#D7000F;
      border-radius:2px
  }
  .vid_6dzcjonxof{
      width:100%;
      display:flex;
      flex-direction:column;
      flex-wrap:undefined;
      margin-top:16px;
      padding-right:16px;
      padding-left:16px;
      background-color:rgba(255, 255, 255, 1);
      border-radius:6px
  }
  .vid_fpwv36k9re{
      width:100%;
      display:flex;
      align-items:center;
      flex-wrap:undefined;
      margin-top:16px
  }
  .vid_smwvdp5o43{
      width:100%;
      display:flex;
      flex-direction:row;
      justify-content:flex-end;
      flex-wrap:undefined
  }
  .vid_3beahpfrj3{
      margin-left:16px;
      color:rgba(215, 0, 15, 1);
      box-shadow:0px 0px 0px 0px ;
      border-style:solid;
      border-width:1px;
      border-color:#FFFFFF
  }
  .vid_vk9gw8xwnc{
      margin-right:16px;
      color:rgba(215, 0, 15, 1);
      border-style:solid;
      border-width:1px;
      border-color:#D7000F
  }
  .vid_dpvyypxome{
      color:rgba(215, 0, 15, 1);
      border-style:none;
      border-width:1px;
      border-color:#D7000F
  }
  .vid_647uqdy6do{
      margin-left:16px;
      color:rgba(255, 255, 255, 1);
      background-color:rgba(215, 0, 15, 1);
      border-style:solid;
      border-width:1px;
      border-color:#D7000F;
      border-radius:2px
  }
  .vid_71pl2koca3{
      padding-left:8px;
      font-weight:600;
      font-size:16px;
      border-left-style:solid;
      border-left-width:6px;
      border-left-color:#D7000F
  }
  .vid_sys0jtyggj :deep(.@{ant-prefix}-table-thead) > tr {
      height: 40px;
  }
  .vid_sys0jtyggj :deep(.@{ant-prefix}-table-thead) > tr > th {
    background: #F5F5F5;
    font-size: 14px;
    font-family: arial, helvetica, "microsoft yahei";;
    font-weight: 600;
    color: #262626;
    border-bottom:1px solid #D9D9D9;
    padding: 0 24px;
  }
  .vid_sys0jtyggj :deep(.@{ant-prefix}-table.@{ant-prefix}-table-bordered) > .@{ant-prefix}-table-container > .@{ant-prefix}-table-content > table > thead > tr:not(:last-child) > th {
    border-bottom:1px solid #D9D9D9;
  }
  .vid_sys0jtyggj :deep(.@{ant-prefix}-table.@{ant-prefix}-table-bordered) > .@{ant-prefix}-table-container > .@{ant-prefix}-table-content > table > thead > tr > th {
    border-right:1px solid #D9D9D9;
  }
  .vid_sys0jtyggj :deep(.@{ant-prefix}-table.@{ant-prefix}-table-bordered) > .@{ant-prefix}-table-container {
    border-left: none;
  }
  .vid_sys0jtyggj :deep(.@{ant-prefix}-table.@{ant-prefix}-table-bordered) > .@{ant-prefix}-table-container > .@{ant-prefix}-table-content > table > thead > tr > th:first-child {
    border-left:1px solid #D9D9D9;
  }
  .vid_sys0jtyggj :deep(.@{ant-prefix}-table.@{ant-prefix}-table-bordered) > .@{ant-prefix}-table-container > .@{ant-prefix}-table-content > table {
    border-top:1px solid #D9D9D9;
  }
  .vid_sys0jtyggj :deep(.@{ant-prefix}-table-thead) > tr > th:not(:last-child):not(.@{ant-prefix}-table-selection-column):not(.@{ant-prefix}-table-row-expand-icon-cell):not([colspan])::before {
      background: #D9D9D9;
      width: 1px;
  }
  .vid_sys0jtyggj :deep(.@{ant-prefix}-table-cell-scrollbar) {
      box-shadow: none;
  }
  .vid_sys0jtyggj :deep(.@{ant-prefix}-table-tbody) tr {
    height: 40px;
  }
  .vid_sys0jtyggj :deep(.@{ant-prefix}-table-tbody) tr > td {
    font-size: 14px;
    font-family: arial, helvetica, "microsoft yahei";;
    font-weight: 400;
    color: #595959;
    border-bottom:1px solid #EBEBEB;
    padding: 0 24px;
    word-break: break-all;
  }
  .vid_sys0jtyggj :deep(.@{ant-prefix}-table-empty .@{ant-prefix}-table-tbody tr > td) {
    padding: 0;
  }
  .vid_sys0jtyggj :deep(.@{ant-prefix}-table-tbody) tr > td .@{ant-prefix}-btn {
    padding: 0 30px 0 0;
  }
  .vid_sys0jtyggj :deep(.@{ant-prefix}-table-tbody) tr > td .@{ant-prefix}-btn:last-child {
    padding: 0;
  }
  .vid_sys0jtyggj :deep(.table-striped-odd) td {
    background-color: #FFFFFF;
  }
  .vid_sys0jtyggj :deep(.table-striped-even) td {
    background-color: #FAFAFA;
  }
  .vid_sys0jtyggj :deep(.@{ant-prefix}-table.@{ant-prefix}-table-bordered) > .@{ant-prefix}-table-container > .@{ant-prefix}-table-content > table > tbody > tr > td {
    border-right:1px solid #EBEBEB;
  }
  .vid_sys0jtyggj :deep(.@{ant-prefix}-table.@{ant-prefix}-table-bordered) > .@{ant-prefix}-table-container > .@{ant-prefix}-table-content > table > tbody > tr > td:first-child {
    border-left:1px solid #EBEBEB;
  }
  .vid_sys0jtyggj{
      width:100%;
      margin-top:16px
  }
  .vid_sys0jtyggj:active{
      width:100%
  }
  .vid_sys0jtyggj:focus{
      width:100%
  }
  .vid_sys0jtyggj:hover{
      width:100%
  }
// //     /deep/.ant3-upload >.al-upload-button>span:nth-child(3) {
// //     display: none;
// // }
// :deep(.ant3-upload .al-upload-button span:nth-child(3)){
//   display: none;
// }
// .vid_dpvyypxome span:nth-child(3){
//   display: none;
// }
// /deep/.ant3-upload span:nth-child(3) {display: none;}
</style>
